<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\apply_supplier_before;

/**
 * 是否申请过供应商
 * @package app\user_center\behavior\user\apply_team_leader_before
 * @author shiqiang
 */
class applyOrNot{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$user_id 	= $params['user_id'];
		
		$map = [];
		$map[] = ['user_id', '=', $user_id];
		$map[] = ['supplier_status', 'in', [0,1]];
		$result = model('UcApplySupplier', 'model\user') -> where($map) -> find();
		if(!empty($result)){
			return array_out(-1001,'您已经申请过团长了，请勿重复申请');
		}
    }
}
